package com.chandra.pos.employee.model;

/* @(#) EmployeeModel.java
 * Copyright 2013 - 2015 QatarAirways Group. All Rights Reserved.
 *
 * This Software is the proprietary information of QR Group
 * Use is subject to License terms.
 * Created by T4671 on 18/03/2015.
 */

import com.chandra.pos.common.model.POSConstant;
import com.chandra.pos.employee.dao.entity.EmployeeEntity;
import org.apache.commons.lang.StringUtils;

public class EmployeeModel extends EmployeeEntity {


    public String getName() {
        StringBuilder name = new StringBuilder();


        if(getTitle() !=null)
        name.append(getTitle().getValue());

        name.append(POSConstant.BLANK_STRING);
        name.append(getFirstName());

        if (StringUtils.isNotEmpty(getMiddleName()))
        {
            name.append(POSConstant.BLANK_STRING);
            name.append(getMiddleName());
        }


        name.append(POSConstant.BLANK_STRING);
        name.append(getLastName());

        return name.toString();

    }


}
